[8.x] Set intended URL before email verification #34808
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This brings the same behavior to the
verified
middleware as theauth
andpassword.confirm
middleware. When a user is trying to access a protected route before they have verified their email, they are redirected to theverification.notice
route. Then, when they click the email verification link, they are redirected to the home page, instead of the protected page they intended to access.Example with
laravel/fortify
:/user/profile
./email/verify
./email/verify/{id}/{hash}
./home
or the home page set inconfig/fortify.php
.The same also applies to
laravel/ui
.With this PR, the intended URL will be
/user/profile
, so with some modifications on the Fortify (I'll submit a PR), we can redirect users to the intended page instead.P.S.: Can I submit PR to
laravel/ui
as well?